Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

sorted_array

container.sorted_array

(T 
type
, from Sequence T, less_than_or_equal Binary bool T T)
:
array T
 is
[Module base]
sorted_array -- sorted one-dimensional immutable array

This takes an unsorted array and a compare function as an arguments and
returns a sorted one.

Non-mutating heap sort is used internally. This gives guaranteed performance in
O(n log n) comparisons and assignments for an array of size n.

This is a little wasteful on allocated memory, which is also O(n log n) since
partially sorted arrays are thrown away. This might be improved to use an
in-place heap sort to bring allocated memory down to O(n).

Type Parameters

T
:
Any
[Module base]
array element type

Functions

execute this Sequence of process+args
0.099dev (GIT hash 250922c42fb1dcef5ce7ce89820538f53498ca37)
last changed: 2026-08-14